#pragma once
#include"public_struct.h"
ListNode* deleteDuplicates(ListNode* head) {
	if (!head) { return head; }
	ListNode* p = head;
	while (p->next) {
		if (p->val == p->next->val) {
			ListNode* temp = p->next;
			p->next = p->next->next;
			delete temp;
		}
		else {
			p = p->next;
		}

	}
	return head;
}

void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
	int i = nums1.size() - 1;
	m--;
	n--;
	while (n >= 0) {
		while (m >= 0 && nums1[m] > nums2[n]) {
			swap(nums1[i--], nums1[m--]);
		}
		swap(nums1[i--], nums2[n--]);
	}
}
